package com.yurui;

import com.yurui.proxy.springaop.MyCalculate;
import com.yurui.proxy.springaop.OtherCalculate;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class AopMain {

    public static void main(String[] args) {
        ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext("applicationContext-aop.xml");
//        Calculate calculate = context.getBean(Calculate.class);  //有接口的
        MyCalculate calculateMy = context.getBean(MyCalculate.class);
        OtherCalculate calculateOther = context.getBean(OtherCalculate.class);
//        System.out.println(calculate);
        int add = calculateOther.add(1, 1);
        System.out.println(add);

        System.out.println("-------------------------------n/t/");
        add = calculateMy.add(1, 1);
        System.out.println(add);
    }
}
